package com.liuhaoqi.raletiveblog.service.Impl;

import com.liuhaoqi.raletiveblog.entity.User;
import com.liuhaoqi.raletiveblog.mapper.UserMapper;
import com.liuhaoqi.raletiveblog.service.UserService;
import com.liuhaoqi.raletiveblog.utils.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author liuhaoqi
 * @Date 2020/4/16 15:34
 * @Version 1.0
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public int updateUserByUserId(User user) {
        return 0;
    }

    @Override
    public User getUserByUsername(String username) {
        return userMapper.getUserByUsername(username);
    }

    @Override
    public User checkUser(String username, String password) {
        return userMapper.checkUser(username, MD5Utils.code(password));
    }

    @Override
    public List<User> getUserMsg() {
        return userMapper.getUserMsg();
    }
}
